package models

//身份证二要素返回码
const (
	RC_BANK_YIZHI RcBank = iota+1000
	RC_BANK_NOT_YIZHI
	RC_BANK_FAIL_CHECK
	RC_BANK_ELLEGAL_NAME
	RC_BANK_ELLEGAL_CARD_BANK
	RC_BANK_ELLEGAL_CARD_ID
	RC_BANK_ELLEGAL_PHONE
	RC_BANK_ERR_STATE
	RC_BANK_NO_INFO
	RC_BANK_USER_DISABLE
	RC_BANK_NO_SUPPORT
	RC_BANK_MANY_CHECK
	RC_BANK_MANY_REQUESST
	RC_BANK_MANY_ID
	RC_BANK_MANY_FAIL_BANK
	RC_BANK_MANY_FAIL_ID
	RC_BANK_ERROR_AGE
)

var (
	bankdescs = map[RcBank]string{
		RC_BANK_YIZHI:"一致",
		RC_BANK_NOT_YIZHI:"不一致",
		RC_BANK_FAIL_CHECK:"无法验证",
		RC_BANK_MANY_ID:"同一身份证号调用次数达到上限，请12小时后再请求",
		RC_BANK_ELLEGAL_NAME:"姓名不合法",
		RC_BANK_ELLEGAL_CARD_BANK:"卡号不合法",
		RC_BANK_ELLEGAL_CARD_ID:"身份证号码不合法",
		RC_BANK_ELLEGAL_PHONE:"手机号不合法",
		RC_BANK_MANY_REQUESST:"请求过于频繁，请稍后重试",
		RC_BANK_ERR_STATE:"银行卡状态异常",
		RC_BANK_NO_INFO:"查无信息",
		RC_BANK_USER_DISABLE:"该用户信息被风控",
		RC_BANK_MANY_CHECK:"验证次数超限，请次日重试",
		RC_BANK_NO_SUPPORT:"暂不支持该卡查询",
		RC_BANK_MANY_FAIL_BANK:"该卡今日验证失败次数过多，请次日重试",
		RC_BANK_MANY_FAIL_ID:"该证件号今日验证失败次数过多，请次日重试",
		RC_BANK_ERROR_AGE:"查询失败,年龄不支持验证",
	}
)

//银行卡返回码结构体
type RcBank int

func (this RcBank) Desc() string {
	return bankdescs[this]
}

func (this RcBank) Code() int {
	return int(this)
}